package com.borrowed.book.membercard.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName s_membercard_user
 */
public class SMembercardUser implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type= IdType.AUTO)
    private Long id;

    /**
     * 会员卡ID
     */
    private Long cardId;

    /**
     * 会员卡编号
     */
    private String cardNum;

    /**
     * 用户唯一标识
     */
    private String openId;

    /**
     * 有效开始日期
     */
    private Date startTime;

    /**
     * 有效结束日期
     */
    private Date endTime;

    /**
     * 有效状态  1：有效  2：过期
     */
    private String status;

    /**
     * 同时借阅次数
     */
    private Integer borrowTimes;

    /**
     * 过期时间
     */
    private Date invalidTime;

    /**
     * 创建时间
     */
    private Date createTime;

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 会员卡ID
     */
    public Long getCardId() {
        return cardId;
    }

    /**
     * 会员卡ID
     */
    public void setCardId(Long cardId) {
        this.cardId = cardId;
    }

    /**
     * 会员卡编号
     */
    public String getCardNum() {
        return cardNum;
    }

    /**
     * 会员卡编号
     */
    public void setCardNum(String cardNum) {
        this.cardNum = cardNum;
    }

    /**
     * 用户唯一标识
     */
    public String getOpenId() {
        return openId;
    }

    /**
     * 用户唯一标识
     */
    public void setOpenId(String openId) {
        this.openId = openId;
    }

    /**
     * 有效开始日期
     */
    public Date getStartTime() {
        return startTime;
    }

    /**
     * 有效开始日期
     */
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    /**
     * 有效结束日期
     */
    public Date getEndTime() {
        return endTime;
    }

    /**
     * 有效结束日期
     */
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    /**
     * 有效状态  1：有效  2：过期
     */
    public String getStatus() {
        return status;
    }

    /**
     * 有效状态  1：有效  2：过期
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * 同时借阅次数
     */
    public Integer getBorrowTimes() {
        return borrowTimes;
    }

    /**
     * 同时借阅次数
     */
    public void setBorrowTimes(Integer borrowTimes) {
        this.borrowTimes = borrowTimes;
    }

    /**
     * 过期时间
     */
    public Date getInvalidTime() {
        return invalidTime;
    }

    /**
     * 过期时间
     */
    public void setInvalidTime(Date invalidTime) {
        this.invalidTime = invalidTime;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SMembercardUser other = (SMembercardUser) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCardId() == null ? other.getCardId() == null : this.getCardId().equals(other.getCardId()))
            && (this.getCardNum() == null ? other.getCardNum() == null : this.getCardNum().equals(other.getCardNum()))
            && (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getBorrowTimes() == null ? other.getBorrowTimes() == null : this.getBorrowTimes().equals(other.getBorrowTimes()))
            && (this.getInvalidTime() == null ? other.getInvalidTime() == null : this.getInvalidTime().equals(other.getInvalidTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCardId() == null) ? 0 : getCardId().hashCode());
        result = prime * result + ((getCardNum() == null) ? 0 : getCardNum().hashCode());
        result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getBorrowTimes() == null) ? 0 : getBorrowTimes().hashCode());
        result = prime * result + ((getInvalidTime() == null) ? 0 : getInvalidTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", cardId=").append(cardId);
        sb.append(", cardNum=").append(cardNum);
        sb.append(", openId=").append(openId);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", status=").append(status);
        sb.append(", borrowTimes=").append(borrowTimes);
        sb.append(", invalidTime=").append(invalidTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}